Coding with Assembler problem

xTripper

Honorable
Dec 2, 2013
4
0
10,510
Hello, I've started to program in Assembler and I got this task to tell the number of all upper case letters. I've got this code, but when I try to compile it an error pops out. Do you know where the problem could be?

CODE

.model small

.stack 100h

.data

type db "Your text: "
enter db 10, 13, "$"
bufer db 255
read db ?
result db "Result: $"
number db 0

.code

start:

mov ax, @data
mov ds, ax

mov ah, 9
mov dx, offset type
int 21h

mov ah, 0Ah
mov dx, offset bufer
int 21h

mov ah, 9
mov dx, offset enter
int 21h

mov cl, read
mov bx, offset bufer
mov dl, 'A'
mov dh, 'Z'

ciklas:

CMP [ds:bx], dl
JBE not
CPM [ds:bx], dh
JAE not
INC skaicius

not:
INC bx

DEC cl
CMP cl, 0
JNE ciklas

MOV byte ptr [ds:bx], '$'

mov ah, 9
mov dx, offset result
int 21h

mov ah, 4Ch
mov al, 0
int 21h

END start


Any tips?
 
(1) Given the simplicity of the program and the first interrupt (21h), it's clear that it's for DOS.

(2) The assembler being used seems to be MASM.

Solution: Not doing your homework, sorry.
 

Could it that OP is trying original 16-bit MASM.EXE, on 64-bit Windows?
 


Anything is possible. It could be that they're mixing syntax, but it's just as easy to say that they should be using DOSBox or Bochs -- of course, it'll require a proper license for MS-DOS.