高分求一些汇编的问题. 急!(24小时内)

来源:百度知道 编辑:UC知道 时间:2024/05/04 17:29:16
1.Write a program that uses a procedure. The procedure is to add two variables that have been placed in the AX and BX registers, and leave the result in the AX register.

2.Change the method of passing parameters so that the SI register acts as a pointer to the first variable in a table of six byte-size variables. When the procedure returns, all registers must remain unchanged except the AX register which will contain the sum of the six variables.

Interrupt Routines using BIOS Interrupts 10H and 16H
3. Write a program that reads the key that you press on the keyboard, and displays the ASCII character at the top left corner of a blank screen. The program should repeat reading the keyboard and displaying the character until you press x, at which time the program should exit to DOS.
Note: Do not use any DOS interrupts.

4. Write a program that reads a string of characters from the keyboard, then displays that string on the middle line of a blan

1

assume cs:code, ds:datas, ss:stack

datas segment
var1 dw 123
var2 dw 456
sum dw ?
datas ends

stack segment
db 16 dup (?)
stack ends

code segment
start:
;初始工作
mov ax, datas
mov ds, ax
mov ax, stack
mov ss, ax
mov sp, 16

;调用plus,求var1和var2的和,结果存在sum单元中
mov ax, [var1]
mov bx, [var2]
call plus
mov sum, ax

;Done!
mov ax, 4c00h
int 21h

;plus子过程
plus:
add ax, bx
ret
code ends
end start

2

assume cs:code, ds:datas, ss:stack

datas segment
vars db 1,2,3,4,5,6
sum dw ?
datas ends

stack segment
db 16 dup (?)
stack ends

code segment
start:
;初始工作
mov ax, datas
mov ds, ax
mov ax, stack
mov ss, ax
mov sp, 16

;获得数组首地址, 调用get_sum过程, 结果存入sum