匯程式設計序 菜鳥IT工程師的工資

2021-09-23 18:00:16 字數 1387 閱讀 8666

有8位it菜鳥工程師,第一行資料是他們的基本工資,第二行是績效工資,程式設計求出總工資放在第三行。

多多多多加工資哈。

data segment

dw 6290, 7230, 2943, 3360, 7469, 6871, 3067, 3086

dw 7288, 7160, 5733, 7030, 5281, 6891, 4853, 4539

dw 0,0,0,0,0,0,0,0

data ends

解法1:

assume cs:codesg, ds:datasg

datasg segment

dw 6290, 7230, 2943, 3360, 7469, 6871, 3067, 3086

dw 7288, 7160, 5733, 7030, 5281, 6891, 4853, 4539

dw 0,0,0,0,0,0,0,0

datasg ends

codesg segment

start:

mov ax, datasg

mov ds, ax

mov cx, 8

mov bx, 0

next: mov ax, [bx]

add ax, [bx+16]

mov [bx+32], ax

inc bx

inc bx

loop next

mov ax,4c00h

int 21h

codesg ends

end start

解法2:(請自行補上缺失的部分)

assume cs:codesg, ds:datasg

datasg segment

dw 6290, 7230, 2943, 3360, 7469, 6871, 3067, 3086

dw 7288, 7160, 5733, 7030, 5281, 6891, 4853, 4539

dw 0,0,0,0,0,0,0,0

datasg ends

codesg segment

start: mov ax, datasg

mov ds, ax

mov cx, 8

mov bx, 0

mov si, 16

nov di, 32

next: mov ax, [...]

add ax, [...]

mov [...], ax

; 改變指示位址的暫存器

loop next

mov ax,4c00h

int 21h

codesg ends

end start

匯程式設計序的Hello world

一 匯程式設計序的hello world x86 at t data msg ascii hello world,hello at t asm n len msg text global start start movl len,edx 顯示的字元數 movl msg,ecx 緩衝區指標 movl ...

自寫的匯程式設計序

哈哈,今個兒真高興呀!現在特地將自己編的程式掛到部落格上,還請各位高手多多指點!同時也給自己及所有正在研究學習彙編的朋友鼓鼓勁!以下是我自己寫的程式 assume cs codesg data segment db 1975 1976 1977 1978 1979 1980 1981 1982 19...

匯程式設計序的簡化寫法

說明 組合語言提供了段定義等的簡化寫法的偽操作,可以使 寫得更簡略一些。要將組合語言作為工作語言使用的同學,可以在這一方面找資料深入一些 案例 輸出hello world 8086 model small data str db hello world stack 20h code start mo...