Re: delete bytes
- From: "almas" <almes@xxxxxxxxxx>
- Date: Mon, 28 Apr 2008 12:14:41 +0200
Hi,
I use A86, but may be, i have to use nasm, we will speak same langage.
Regards
Almas
"Herbert Kleebauer" <klee@xxxxxxxxx> a écrit dans le message de news:
48159C6F.D038B360@xxxxxxxxxxxx
almas wrote:
I make a com file with your part of code.
When i put ">" i change the value
I made the file bytes, after bytes....
then i do dis file.com.... and obtain below :
I never found out whether your post are meant serious or if you
are just playing a game with us. Did you you really retype the
hex codes instead of a copy and paste? Here the code in NASM
syntax, assemble it with "nasm convert.asm -o convert.com".
But I really can't advise an assembler which gives an error when
using the label "loop". I think the "short" and "byte" are not
necessary, but the NASM disassembler put it there.
org $100
xor bp,bp ; clear flag
loop1: call getc ; get char from stdin
cmp ax,-1 ; EOF
jnz .10 ; branch if not
jmp exit ; exit program
.10: cmp al,$21
jc .20
cmp al,$2f
ja .20
test bp,bp
jnz loop1 ; not the first character $21-$2f
or bp,byte 1 ; set flag
jmp short .30
.20: xor bp,bp ; clear flag
.30: call putc ; write char to stdout
jmp short loop1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
putc: pusha
mov ah,$40
mov dx,sp
add dx,byte 14
mov cx,1
mov bx,1
int $21
popa
ret
getc: xor ax,ax
pusha
mov ah,$3f
mov dx,sp
add dx,byte 14
mov cx,1
xor bx,bx
int $21
jc .10
cmp cx,ax
jnz .10
popa
ret
.10: popa
or ax,byte -1
ret
exit: mov ah,$4c
int $21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.
- Follow-Ups:
- Re: delete bytes
- From: Herbert Kleebauer
- Re: delete bytes
- From: Frank Kotler
- Re: delete bytes
- References:
- delete bytes
- From: almas
- Re: delete bytes
- From: almas
- Re: delete bytes
- From: Rod Pemberton
- Re: delete bytes
- From: almas
- Re: delete bytes
- From: Herbert Kleebauer
- Re: delete bytes
- From: almas
- Re: delete bytes
- From: Herbert Kleebauer
- delete bytes
- Prev by Date: Re: delete bytes
- Next by Date: Re: to make a TSR
- Previous by thread: Re: delete bytes
- Next by thread: Re: delete bytes
- Index(es):
Relevant Pages
|