News:

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

Main Menu

how to find what's in a field in GoBug

Started by shankle, November 05, 2012, 09:08:39 AM

Previous topic - Next topic

shankle

Problem stated in the Title has been solved.
The program I have been working on was written in MASM32
and I want to convert it to GoAsm.
It uses simple math(add/subtract). Somewhere I read that GoAsm
handles math differently than MASM32 does
I simply can't find that text.
Obviously the program is not working and I think that is my problem.


wjr

So you are well on your way now with the GoBug data and symbol inspectors... another quick way when working with data in memory is with the "inspect / data by register" option, as it has a nice little track button to update things as your pointer moves around.

For GoAsm help, Alphabetical Index under Arithmetic... "Arithmetic in brackets is carried out first, otherwise calculations are carried out in strict left-to-right order." There shouldn't be a problem with just add and subtract, but if there is one along with multiply or divide, that should be checked out for a possible bracket adjustment.

shankle

Thank you WJR for responding.
     11-6-2012
; converting a Masm32 32-bit program to GoAsm 32-bit     
; this code shows an error when run in GoBug

FileBuffer is initialized to 30303030303030303030
EndBal contains  01e78h
mhold  contains  01bbch
savediff contains 02bch
savediff is arrived at by subtracting mhold from EndBal

This is what FileBuffer looks like after dwtoa is executed:
      37303000303030303030
I have no idea where the (00) came from in the 4th byte
unless it's from savediff which shows as bc020000             
Of course it is invalid and should be 30


BufAdd      dd 0
EndBal      dd 0
mhold       dd 0
savediff    dd 0
minusplus   db 0
FileBuffer  db '          ',0   

         mov ebx,D[EndBal]
         mov ecx,ebx
         sub ebx,D[mhold]
         mov [savediff],ebx     ; to be converted in .N45         
         mov eax,D[mhold]
         cmp ecx,eax     ; ecx < is plus, ecx > is minus
          jl >.N44
          mov B[minusplus], "-"
          jmp >.N45
.N44
          mov B[minusplus], "+"
.N45
         mov ecx,[savediff]   ; input record -- EndCkBal - MathHold
         lea ebx, FileBuffer
         mov [BufAdd], ebx
; dwtoa is a MASM32 goody         
         invoke dwtoa, ecx,[BufAdd]      ; Hex DD to string
                                         ; output is in FileBuffer


Another item about GoBug - in Run To - how do I clear all the addresses I have
keyed in?

wjr

Invalid depends upon what you are trying to do. dwtoa returns a null terminated string, and 700 looks good to me.

I don't think there is a way to clear those addresses (other than the drastic deletion of GoBug.ini).