ok, that explains that but I still can't figure out how to pin-point the issue. i am able to print all of the extended ASCII characters with the below code
Code: Select all
; baby.asm
mov ax, 0x07c0
mov ds, ax
mov al, 0xFF
test_loop:
cmp al, 0 ;check if done
je hang ;exit if done
mov ah, 0x0E ;specify to print chcracter
int 0x10 ;print chracter
dec al ;next lower value
jmp test_loop;loop back
hang:
jmp hang
msg db 'Welcome to Macintosh', 13, 10, 0
times 510-($-$$) db 0
db 0x55
db 0xAA
but the following code(which is meant to print msg) dose nothing
Code: Select all
; baby.asm
mov ax, 0x07c0
mov ds, ax
mov si, msg
test_loop:
mov al, byte[si] ;load byte from si
cmp al, 0 ;check if done
je hang ;exit if done
mov ah, 0x0E ;specify to print chcracter
int 0x10 ;print chracter
inc si ;next lower value
jmp test_loop;loop back
hang:
jmp hang
msg db 'Welcome to Macintosh', 13, 10, 0
times 510-($-$$) db 0
db 0x55
db 0xAA
I'm going to see if i can write a small function to print the value of al in octal.
edit: although it prints the number backwards, my small test function showed me that byte[si] is zero when im trying to print it so the loop just exits before any characters are printed. what's up with that?? shouldn't it be at the front of block?
edit2: fixed backward thing
here is the function that prints AL in octal
Code: Select all
;function for printing al in octal
;it clobers bl, and bh
printOct:
mov bh, al ;store al for later
shr al, 6 ;first digit
call printOctDigit
mov al, bh ;restore
shr al, 3 ;second digit
call printOctDigit
mov al, bh ;last digit
call printOctDigit
mov al, 0x20 ;for space chracter
mov ah, 0x0E ;specify to print chcracter
int 0x10 ;print chracter
mov al, bh
ret
printOctDigit:
mov bl, al ;store al for later
and al, 7 ;mask first 2 digits
mov ah, 0x0E ;specify to print chcracter
add al, 0x30 ;al += '0' to get ASCII digit value
int 0x10 ;print chracter
mov al, bl ;restore al
ret