Do me a favor, about three days, I beg you, help me!

assume cs:code,ds:xinyi,ss:start
xinyi segment
db 'welcome to masm!'
db 0ah,2ch,79h
xinyi ends

start segment
dw 0,0,0,0,0,0,0,0
start ends

code segment
data:mov ax,start
mov ss,ax
mov ax,10h
mov sp,ax
mov di,0
mov bx,16
mov si,0
mov ax,xinyi
mov ds,ax

s: mov ax,[bx]
push ax

mov ax,[di]
push ax

mov dx,0b800h
mov ds,dx
pop ax
mov [si],ax
inc si
pop ax
mov [si],ax
inc di
loop s
inc bx
jmp short s

mov ah, 0
int 16h

mov ax,4c00h
int 21h


code ends
end data

To see how wrong
I want to display welcome to MASM on the screen!

Started by Joanna at February 02, 2016 - 1:23 AM

Interrupt call directly to the output string is good. The need for such a long code?

Posted by Derek at February 10, 2016 - 1:52 AM

I'm here where the wrong ah, how to do. After the operation of exe flash is gone

Posted by Joanna at February 20, 2016 - 2:22 AM

At least loop does not set the CX, JMP s formed the cycle of death there is no exit mechanism; show function seems to be wrong

Posted by Bevis at February 26, 2016 - 3:22 AM

assume cs:code,ds:xinyi,ss:start
xinyi segment
db 'welcome to masm!'
db 0ah,2ch,79h
xinyi ends

start segment
dw 0,0,0,0,0,0,0,0
start ends

code segment
data:
mov cx,16
mov ax,start
mov ss,ax
mov ax,10h
mov sp,ax
mov di,0
mov bx,16
mov si,0
mov ax,xinyi
mov ds,ax

s: mov ax,[bx]
push ax

mov ax,[di]
push ax

mov dx,0b800h
mov ds,dx
pop ax
mov [si],ax
inc si
pop ax
mov [si],ax
inc di
loop s
inc bx
jmp short s

mov ah, 0
int 16h

mov ax,4c00h
int 21h


code ends
end data

Posted by Joanna at March 08, 2016 - 3:28 AM

I changed, but still not. 555555

Posted by Joanna at March 10, 2016 - 4:21 AM

JMP s dead cycle where to change? Here is the change as you down, or as a reference
assume cs:code,ds:xinyi,ss:start
xinyi segment
str1 db 'welcome to masm!'
att1 db 0ah,2ch,79h
xinyi ends

start segment
dw 0,0,0,0,0,0,0,0
start ends

code segment
data:mov ax,start
mov ss,ax
mov ax,10h
mov sp,ax
mov di,offset att1
mov bx,offset str1
mov si,0
mov ax,xinyi
mov ds,ax
mov ax, 0b800h
mov es, ax
mov cx, att1-str1

s: mov al,[bx]
; push ax

mov ah,[di]
; push ax

; mov dx,0b800h
; mov ds,dx
; pop ax
mov es:[si],ax
inc si
; pop ax
; mov [si],ax
inc di
inc bx
inc di
cmp di, 3
jne l_
mov di, offset att1
l_:
loop s
; inc bx
; jmp short s

mov ah, 0
int 16h

mov ax,4c00h
int 21h

code ends
end data

Posted by Bevis at March 21, 2016 - 5:02 AM

; mov [si],ax
inc di ; This should be Inc Si can in fact and the above Inc Si with add Si, 2

Posted by Bevis at April 05, 2016 - 5:56 AM

Thank you very much!!!

Posted by Joanna at January 04, 2017 - 12:44 AM

Halo, there is a mistake
 cmp di, offset att1 + 3 ;*
jne l_
mov di, offset att1
l_

Posted by Bevis at January 10, 2017 - 11:27 PM

I'm doing this well,,, Wang Shuangshu.
---------------------
Using 80*25 to display in the books
But why not write BIOS calls:
mov al,03H
mov ah,00h
int 10h


Can also display the color character? ? ? ?
It is the default this display mode? ? ?

Posted by Clark at January 12, 2017 - 11:49 PM


data1 segment
msg db 'welcome to masm!',0dh,0ah,"$"
data1 ends
code1 segment
assume cs:code1,ds:data1
start:
mov ax,data1
mov ds,ax
lea dx,msg
mov ah,9
int 21h
mov ax,4c00h
int 21h
code1 ends
end start
Directly, which can achieve the effect you want, your code, mainly to see your cycle!

Posted by Barret at January 15, 2017 - 12:03 AM