My information is coming from here. The assignment asks for a program that reads in no more than 20 characters, converts those characters to upper case, and then prints the input as capitals.
I have no idea how to access the input from int21/AH=0ah. I really can't ask a more precise question unless I understand what is linked above. Can someone explain? Also, I'm using TASM if that makes any difference. Also, I'm testing this on freedos.
UPDATE1:
Alright, thanks to your help, I believe I understand how the interrupt needs to be set up and behaves.
Setup:
I have to designate a ds:dx where I want this buffer to exist
I have to set ds:dx to 20 (which sets the max number of characters the buffer can hold)
I have to set ds:dx+1 to 0 (which I think somehow set a min number of characters to read in)
Actually call int21/AH=0ah, which will go to ds:dx and interpret the preset bytes. It will halt the program while it waits for input
int21/AH=0ah will fill from ds:dx+2+n with my input (where n is the number of characters input including '
')
My question is now, how do I do this. I've just looked through the x86 Assembly Language Reference again, but haven't been able to find anything helpful yet.
Code I've got so far
assume cs:code,ds:code
code segment
start:
mov ax,code ;moves code segment into reg AX
mov ds,ax ;makes ds point to code segment
mov ah,0ah
int 21h
mov ax,1234h ;breakpoint
mov ah,9
mov dx,offset message
int 21h
endNow:
;;;;;;;;;;ends program;;;;;;;;;;
mov ah,0 ;terminate program
int 21h ;program ends
message db 'Hello world!!!',13,10,'$'
code ends
end start
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…