어셈블러의 간소화 쓰기
[사례] Hello World 출력!
.8086
.MODEL small
.data
str db 'hello world!$'
.stack 20H
.code
start: mov ax,@data
mov ds,ax
lea bx,str ; mov bx, 0 。 , debug
output:mov dl, [bx]
cmp dl, '$'
je stop
mov ah, 02H
int 21h
inc bx
jmp output
stop: mov ax,4c00h
int 21h
end start
다음 쓰기 작업은 동일한 결과를 가져옵니다.
assume cs:codesg, ss:stacksg, ds:datasg
stacksg segment
db 32 dup (0)
stacksg ends
datasg segment
str db 'hello world!$'
datasg ends
codesg segment
start: mov ax,datasg
mov ds,ax
mov ax, stacksg
mov ss, ax
mov sp, 20h
lea bx,str
output:mov dl, [bx]
cmp dl, '$'
je stop
mov ah, 02H
int 21h
inc bx
jmp output
stop: mov ax,4c00h
int 21h
codesg ends
end start
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
첫 번째 어셈블리 포함 C 프로그램최근 이틀 동안 linux 핵을 배우기 시작했는데 조형 박사의 《linux 핵 완전 주석》을 보니 이득이 적지 않았다.오늘 제3장이 어셈블리 부분에 박혀 있는 것을 보고 작은 프로그램을 써서 시험해 보았는데 gcc로...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.