操作数类型不匹配

时间:2018-12-27 08:28:48

标签: assembly x86-16 tasm

第66行出现错误operand types do not match

我正在使用tasm

.MODEL SMALL
.STACK 128

.DATA
    begin DB "Press any character: $"
    prompt1 DB "Character: '$"
    prompt2 DB "ASCII Code: $"
    apostrophe  DB "' $"
    result DB ?
    character DB ?
    d1 DB ?
    d2 DB ?
    d3 DB ?
    temp DB ?

    newln DB 0Dh, 0Ah, '$'

.CODE
    main:
    ;initializes the DS Register
    MOV AX, @DATA
    MOV DS, AX

    ;Display the "Press any character:" message
    LEA DX, begin
    MOV AH, 09h
    INT 21h

    ;Get the character pressed
    MOV AH, 01h
    INT 21h
    MOV character, AL ; assign the value to first digit variable
    ;Print new line
    LEA DX, newln
    MOV AH, 09h
    INT 21h


    ;Display the "Character: " message
    LEA DX, prompt1
    MOV AH, 09h
    INT 21h

    ;Display character
    MOV DL, character ;assign the character value to DL
    MOV AH, 02h
    INT 21h

    ;Display apostrophe 
    LEA DX, apostrophe
    MOV AH, 09h
    INT 21h

    ;Print new line
    LEA DX, newln
    MOV AH, 09h
    INT 21h


    MOV AX, character
    MOV BL, 1D
    IDIV BL


    ;Display character
    MOV DL, AL ;assign the character 3rd digit to DL
    MOV AH, 02h
    INT 21h



    MOV AL, character
    MOV BL, 1D
    SUB  AL, BL

        ;Display character
    MOV DL, AL ;assign the character 3rd digit to DL
    MOV AH, 02h
    INT 21h




    ;Terminate the program
    MOV AH, 4CH
    INT 21h

END main

0 个答案:

没有答案