flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
smiddy 05 Oct 2006, 12:35
Hi BlueLED,
So what is your trouble, the clicking? Reading your code above, it would appear that if you wrote it to the very first sector of your floppy disc that you would do a continual reboot, just after printing Hello This is My First Boot Program! Press any key to reboot and you hitting a key to continue. I assume this is what it is doing, yes? |
|||
![]() |
|
Dex4u 05 Oct 2006, 15:27
Maybe try this:
Code: ORG 7C00hstart:PUSH CS ; make sure DS=CSPOP DS; load message address into SI register:LEA SI, msg; teletype function id:MOV AH, 0Ehprint: MOV AL, [SI] CMP AL, 0 JZ done INT 10h ; print using teletype. INC SI JMP print; wait for 'any key':done: MOV AH, 0 INT 16h; store magic value at 0040h:0072h:; 0000h - cold boot.; 1234h - warm boot.MOV AX, 0040hMOV DS, AXMOV w.[0072h], 0000h ; cold boot.JMP 0FFFFh:0000h ; reboot!new_line EQU 13, 10msg DB 'Hello This is My First Boot Program!' DB new_line, 'Press any key to reboot', 0;*************************************; Make program 510 byte's + 0xaa55;*************************************times 510- ($-start) db 0dw 0xaa55 |
|||
![]() |
|
blueled 05 Oct 2006, 18:22
When I boot it, it doesnt even display the message and wait for my old one.
I tried compiling that Dex4u and it gives me an error saying (7) LEA SI, msg (7) error: invalid operand. Looks fine to me, so i'm not sure what to do ![]() |
|||
![]() |
|
LocoDelAssembly 05 Oct 2006, 19:23
Because is "lea SI, [msg]" or just "mov SI, msg". LEA always need a memory operand (note that LEA never access memory, just store the address), it's typically used for things like "lea bx, [si+di]" or "lea bx, [bp+4]" and things like that but for storing an offset I think MOV is better since it's one byte less).
|
|||
![]() |
|
blueled 05 Oct 2006, 21:28
aha, finally it works! thanks for all the help.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.