News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

cmpal, 02dh

Started by six_L, January 06, 2018, 07:08:12 PM

Previous topic - Next topic

six_L

hi,johnsa
UASM64(WIN) convert the "cmp   al, 02dh" into "cmp   al, 2".
Say you, Say me, Say the codes together for ever.

jj2007

UASM v2.46, Dec 14 2017 works correctly. Which version are you using, six_L?

six_L

Quote from: jj2007 on January 06, 2018, 08:28:43 PM
UASM v2.46, Dec 14 2017 works correctly. Which version are you using, six_L?
ASM v2.46, Dec 14 2017, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

calc_1.asm: 59 lines, 3 passes, 141 ms, 0 warnings, 0 errors
Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.
Say you, Say me, Say the codes together for ever.

jj2007

Same as mine ::)include \masm32\include\masm32rt.inc
.code
start:
  mov al, "-" ; 2d
  cmp al, 02dh
  .if Zero?
inkey "correct"  ; yep
  .else
inkey "wrong"
  .endif
  exit
end start

Can you post a snippet that doesn't work?

six_L

atodq proc uses rsi rdi String:QWORD
   ; ----------------------------------------
   ; Convert decimal string into qword value
   ; return value in rax
   ; ----------------------------------------
   
   xor   rax, rax
   mov   rsi, [String]
   xor   rcx, rcx
   xor   rdx, rdx
   mov   al, [rsi]
   inc   rsi
   cmp   al, 02Dh      ;====>here   
   jne   proceed
   mov   al, [rsi]
   not   rdx
   inc   rsi
   jmp   proceed
@@:
   sub   al, 30h
   lea   rcx, qword ptr [rcx+4*rcx]
   lea   rcx, qword ptr [rax+2*rcx]
   mov   al, [rsi]
   inc   rsi
proceed:
   or   al, al
   jne   @B
   lea   rax, qword ptr [rdx+rcx]
   xor   rax, rdx
   ret

atodq endp
Say you, Say me, Say the codes together for ever.

jj2007

UAsm64:
0000000140001022   | 8A 06                     | mov al,byte ptr ds:[rsi]                |
0000000140001024   | 48 FF C6                  | inc rsi                                 |
0000000140001027   | 3C 2D                     | cmp al,2D                               | 2D:'-'
0000000140001029   | 75 19                     | jne 140001044                           |


Same for UAsm32. Do you use any specific options?

Minor incompatibility: mov rsi, [String] triggers a syntax error with ML64. Instead, the simpler mov rsi, String works with both ML and UAsm.

habran

same here:

   266:    xor   rcx, rcx
00007FF6E2E317EA 48 33 C9             xor         rcx,rcx 
   267:    xor   rdx, rdx
00007FF6E2E317ED 48 33 D2             xor         rdx,rdx 
   268:    mov   al, [rsi]
00007FF6E2E317F0 8A 06                mov         al,byte ptr [rsi] 
   269:    inc   rsi
00007FF6E2E317F2 48 FF C6             inc         rsi 
   270:    cmp   al, 02Dh      ;====>here   
00007FF6E2E317F5 3C 2D                cmp         al,2Dh 
   271:    jne   proceed
00007FF6E2E317F7 75 08                jne         WinMainCRTStartup+1Bh (07FF6E2E31801h) 
   272:    mov   al, [rsi]
00007FF6E2E317F9 8A 06                mov         al,byte ptr [rsi] 
   273:    not   rdx
00007FF6E2E317FB 48 F7 D2             not         rdx 
   274:    inc   rsi
00007FF6E2E317FE 48 FF C6             inc         rsi 
   275: proceed:   
Cod-Father

six_L

hi,all
i'v got the error. sorry
Quoteatodq proc uses rsi rdi String:QWORD
   ; ----------------------------------------
   ; Convert decimal string into qword value
   ; return value in rax
   ; ----------------------------------------
   
   xor   rax, rax
   mov   rsi, [String]
   xor   rcx, rcx
   xor   rdx, rdx
   mov   al, [rsi]
   inc   rsi
   ;cmp   al, "-"   
int 3
   cmp   al, 2Dh   
   jne   proceed
   mov   al, [rsi]
   not   rdx
   inc   rsi
   jmp   proceed
@@:
   sub   al, 30h
   lea   rcx, qword ptr [rcx+4*rcx]
   lea   rcx, qword ptr [rax+2*rcx]
   mov   al, [rsi]
   inc   rsi
proceed:
   or   al, al
   jne   @B
   lea   rax, qword ptr [rdx+rcx]
   xor   rax, rdx
   ret

atodq endp
Say you, Say me, Say the codes together for ever.

johnsa

So did you come right in the end ?

six_L

Quote from: johnsa on January 07, 2018, 11:39:59 PM
So did you come right in the end ?
hi,johnsa
yes. see the post http://masm32.com/board/index.php?PHPSESSID=cec620e4dd421c2eb1a90d06fc181c77&topic=6803.0#msg73171 .
keep up the great works, because it's the easiest step to transit  from masm32 to UASM64. UASM64 inherited most of the masm32's features.
Say you, Say me, Say the codes together for ever.