VOGONS

Common searches


First post, by general_vagueness

User metadata
Rank Member
Rank
Member

I've been working on something and wanted to be sure I was doing this part correctly. I put this into Debug (didn't crash, didn't work) and NASM for Windows and it didn't work (tmp.asm:5: expression syntax error).

MOV AH, 0B
MOV BL, 02
MOV BH, 01
INT 10
MOV AH, 10
MOV AL, 03
MOV BL, 00
INT 10
MOV AH, 0A
MOV AL, 57
MOV CX, 01
INT 10
RET

after that I tried to assemble this (Debug sucks):
MOV AH, 10
MOV AL, 03
MOV BL, 00
INT 10
MOV AH, 0A
MOV AL, 57
MOV CX, 01
MOV BL, 02
INT 10
RET

and it gave be the same error but with 5.
I was trying to just output a light green (I like to call it Matrix green or Tron green) capital W. For this project, I'd have to use a BIOS interrupt, otherwise I'd go with DOS INT 21.
When I get this help, I'll definitely be able to continue immediately and will then post the code and whether it worked or not.
yes, it's a surprise 😁

Last edited by general_vagueness on 2007-11-14, 12:25. Edited 1 time in total.

You cannot fall off the floor.
If you look hard enough, you'll find something you don't like.

How to ask questions the smart way
How to become a hacker
How to answer smart-alec questions

Reply 1 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

did you try hiew as well ?
at least i don't see any problems with this code when you enter it in hiew

maybe the
mov bl, 00
shoulld be
mov bl,0 ?

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 14, by general_vagueness

User metadata
Rank Member
Rank
Member

I'm sorry, what's hiew?
I'll try single digits, I like it when stuff lines up, I almost put 0000.

You cannot fall off the floor.
If you look hard enough, you'll find something you don't like.

How to ask questions the smart way
How to become a hacker
How to answer smart-alec questions

Reply 3 of 14, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hiew is a hex editor with builtin asm/disasm.

Where exactly is the problem, in getting the asm stuff into a .com file
or something, or in the results that are produced by executing this code?

Reply 4 of 14, by general_vagueness

User metadata
Rank Member
Rank
Member

NASM wouldn't assemble it, it just gave me those error messages.
I'm about to try again with single digits.

You cannot fall off the floor.
If you look hard enough, you'll find something you don't like.

How to ask questions the smart way
How to become a hacker
How to answer smart-alec questions

Reply 6 of 14, by general_vagueness

User metadata
Rank Member
Rank
Member

That's what I was just thinking, I didn't think of that before and then I was hoping it wouldn't be needed for something so short.
I'm going to put in proc/section stuff and try again now.

OK,
TESTING PROC NEAR
ORG 100H
MOV AH, 10
MOV AL, 03
MOV BL, 00
INT 10
MOV AH, 0A
MOV AL, 57
MOV CX, 01
MOV BL, 02
INT 10
RET
TESTING ENDP

gave me:
tmp.asm:1: parser: instruction expected
tmp.asm:7: expression syntax error
tmp.asm:13: symbol `TESTING' redefined
tmp.asm:13: parser: instruction expected

more:
TEST_SEG SEGMENT
ASSUME CS:TEST_SEG, DS:TEST_SEG
ORG 100
TEST PROC NEAR
MOV AH, 10
MOV AL, 03
MOV BL, 00
INT 10
MOV AH, 0A
MOV AL, 57
MOV CX, 01
MOV BL, 02
INT 10
RET
TEST ENDP
TEST_SEG ENDS

gave me:
TMP.ASM:1: parser: instruction expected
TMP.ASM:2: parser: instruction expected
TMP.ASM:4: comma or end of line expected
TMP.ASM:9: expression syntax error
TMP.ASM:16: symbol `TEST_SEG' redefined
TMP.ASM:16: parser: instruction expected

I googled at least 15 variations on "assembly test program" and only found 1 with "proc"; only went this route because I previously had ASMEdit and it had a good H,W! program (H,W!=Hello, world!) that I printed.
[edit] it was ASM Edit, apparently they're 2 different programs
I have since deleted it because of the problem, there are other sources (nice help system), and it was nagware. It seems in that short time the authors decided that since they're not working on it any more, it should be completely free, so I have it again and would recommend it.

You cannot fall off the floor.
If you look hard enough, you'll find something you don't like.

How to ask questions the smart way
How to become a hacker
How to answer smart-alec questions

Reply 7 of 14, by general_vagueness

User metadata
Rank Member
Rank
Member

I may have partially solved the problem. I changed "0A" to just "A" and it said "A" was an undefined symbol, so I thought maybe it was a number system problem, so I put "h" after every number, and it assembled without a problem. 😊

ORG 100h
MOV AH, 0Ah
MOV AL, 57h
MOV CX, 01h
MOV BL, 02h
MOV BH, 00h
INT 10h
RET

gave me no errors and a file named "tmp"; I renamed that to "tmp.com", ran it, and it gave me "W", but it wasn't light green... 😕 I'll try some things and report what happens.

OK, I tried my first two... tries,
MOV AH, 0Bh
MOV BL, 02h
MOV BH, 01h
INT 10h
MOV AH, 10h
MOV AL, 03h
MOV BL, 00h
INT 10h
MOV AH, 0Ah
MOV AL, 57h
MOV CX, 01h
INT 10
RET

assembled but didn't do anything when I ran it, and

MOV AH, 10h
MOV AL, 03h
MOV BL, 00h
INT 10h
MOV AH, 0Ah
MOV AL, 57h
MOV CX, 01h
MOV BL, 02h
INT 10h
RET

again gave me a "W" but off-white and not light green. I thought I might mention I've tried these programs in the native command line (Vista) and DOSBox and gotten the same results.
I'm curious, does DOSBox emulate every BIOS display call?

oh, thanks, I thought maybe it should've been 9 instead of A, I pretty much guessed

Last edited by general_vagueness on 2008-04-03, 20:08. Edited 3 times in total.

You cannot fall off the floor.
If you look hard enough, you'll find something you don't like.

How to ask questions the smart way
How to become a hacker
How to answer smart-alec questions

Reply 9 of 14, by general_vagueness

User metadata
Rank Member
Rank
Member

OK,
ORG 100h
MOV AH, 09h
MOV AL, 57h
MOV CX, 01h
MOV BL, 0Ah
MOV BH, 00h
INT 10h
RET

gave me my light green "W". 😁
I want to save space for code wherever possible, does anyone know if the write string (AH=0x13) function is reliable?

You cannot fall off the floor.
If you look hard enough, you'll find something you don't like.

How to ask questions the smart way
How to become a hacker
How to answer smart-alec questions

Reply 11 of 14, by general_vagueness

User metadata
Rank Member
Rank
Member

It took some "shaking out", but it's working so far, now if I could just remember what I was going to do next... 😦

You cannot fall off the floor.
If you look hard enough, you'll find something you don't like.

How to ask questions the smart way
How to become a hacker
How to answer smart-alec questions

Reply 13 of 14, by artelius

User metadata
Rank Newbie
Rank
Newbie

Did you mean...

ORG 100h
MOV AX, 0957h
MOV CX, 01h
MOV BX, 0Ah
INT 10h
RET

(You did say you wanted to save space...)

NASM needs all numbers to start with a digit (i.e. 3h is allowed but you must use 0Ah instead of Ah).

If you prefer C syntax then NASM also supports the 0x... syntax.

Here is a totally different method:

ORG 100h
MOV AX, 0B800h
MOV DS, AX
XOR BX, BX
MOV word [BX], 0A57h
RET

But this one will always write to the top-left corner of the screen (unless you put something else in BX).

I love this stuff, if you want more info I will be glad to oblige.

Reply 14 of 14, by general_vagueness

User metadata
Rank Member
Rank
Member

Actually I've gotten to string writing,

ORG 100h
MOV AH, 13h
MOV AL, 1
MOV CX, 33
MOV BL, 0Ah
MOV BH, 0
MOV DH, 0
MOV DL, 0
MOV BP, 115h
INT 10h
RET
DB "William's *********** version 0.1"

worked just fine, that was what took some work (e.g. mixed up decimal and hex), but that was step 1, I don't remember the other important parts of my project.

You cannot fall off the floor.
If you look hard enough, you'll find something you don't like.

How to ask questions the smart way
How to become a hacker
How to answer smart-alec questions