Author Topic: how to find what's in a field in GoBug  (Read 2683 times)

shankle

  • Member
  • ****
  • Posts: 833
how to find what's in a field in GoBug
« on: November 05, 2012, 09:08:39 AM »
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.
 
 
« Last Edit: November 06, 2012, 09:05:47 AM by shankle »

wjr

  • Member
  • **
  • Posts: 207
    • WJR's website
Re: how to find what's in a field in GoBug
« Reply #1 on: November 07, 2012, 05:20:22 AM »
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

  • Member
  • ****
  • Posts: 833
Re: how to find what's in a field in GoBug
« Reply #2 on: November 07, 2012, 08:32:07 AM »
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

  • Member
  • **
  • Posts: 207
    • WJR's website
Re: how to find what's in a field in GoBug
« Reply #3 on: November 07, 2012, 01:50:17 PM »
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).