SourcePoint Intel Help
Table of Contents
- Using Help
- Contacting ASSET InterTech
- Introduction to SourcePoint
- SourcePoint Environment
- SourcePoint Overview
- SourcePoint Parent Window Introduction
- SourcePoint Icon Toolbar
- File Menu
- File Menu - Project Menu Item
- File Menu - Layout Menu Item
- File Menu - Program Menu Item
- File Menu - Macro Menu Item
- File Menu - Print Menu Items
- File Menu - Update Emulator Flash Menu Item
- File Menu - Program Target Device Menu Item
- File Menu - Other Menu Items
- Edit Menu
- View Menu
- Processor Menu
- Options Menu
- Options Menu - Preferences Menu Item
- Options Menu - Target Configuration Menu Item
- Options Menu - Load Target Configuration File Menu Item
- Options Menu - Save Target Configuration File Menu Item
- Options Menu - Emulator Configuration Menu Item
- Options Menu - Emulator Connection Menu Item
- Options Menu - Emulator Reset Menu Item
- Options Menu - Confidence Tests Menu Item
- Window Menu
- Help Menu
- How To -- SourcePoint Environment
- Add Emulator Connections
- Configure Custom Macro Icons
- Configure Autoloading Macros
- Display Text on the Icon Toolbar
- Edit Icon Groups to Customize Your Toolbars
- Modify a Defined Memory Region
- Refresh SourcePoint Windows
- Save a Program
- Start SourcePoint With Command Line Arguments
- Use the New Project Wizard
- Verify Emulator Network Connections
- SourcePoint Overview
- Breakpoints Window
- Breakpoints Window Overview
- How To - Breakpoints
- Code Window
- Command Window
- Command Window Overview
- Confidence Tests Window
- Confidence Tests Window Overview
- Descriptors Tables Window
- Descriptors Tables Window Overview
- How To - Descriptors
- Devices Window
- Devices Window Overview
- How To - Devices Window
- Log Window
- Log Window Overview
- Memory Window
- Memory Window Overview
- How To - Memory Window
- Page Translation Window
- Page Translation Windows Overview
- PCI Devices Window
- PCI Devices Window Overview
- How To - PCI Devices Window
- Registers Window
- Registers Window Overview
- How To - Registers
- Symbols Windows
- Symbols Window Overview
- How To - Symbols Window
- Trace Window
- Trace Window Overview
- How To - Trace Window
- Advanced
- Viewpoint Window
- Viewpoint Window Overview
- Watch Window
- Watch Window Overview
- How To - Watch Window
- Technical Notes
- Descriptor Cache: Revealing Hidden Registers
- UEFI Framework Debugging
- Memory Casting
- Microsoft PE Format Support in SourcePoint
- Multi-Clustering
- Python/CScripts
- OpenIPC Integration, Installation and Usage
- Registers Keyword Table
- SourcePoint Licensing
- Stepping
- Symbols Textsym Format
- Target Configuration
- Using Bookmarks
- Which Processor Is Which
- Getting Started with DbC
- SourcePoint Command Language
- Overview
- Commands and Control Variables
- aadump
- abort
- abs
- acos
- advanced
- asin
- asm
- asmmode
- atan
- atan2
- autoconfigure
- base
- bell (beep)
- bits
- break
- breakall
- cachememory
- cause
- Character Functions
- clock
- continue
- cos
- cpubreak commands
- cpuid_eax
- cpuid_ebx
- cpuid_ecx
- cpuid_edx
- createprocess
- cscfg, local_cscfg
- csr
- ctime
- cwd
- dbgbreak commands
- defaultpath
- #define
- define
- definemacro
- deviceconfigure
- devicelist
- devicescan
- disconnect
- displayflag
- do while
- dos
- dport
- drscan
- edit
- editor
- emubreak, emuremove, emudisable, emuenable
- emulatorstate
- encrypt
- error
- eval
- evalprogramsymbol
- execution point ($)
- exit
- exp
- fc
- fclose
- feof
- fgetc
- fgets
- first_jtag_device
- flist
- flush
- fopen
- for
- forward
- fprintf
- fputc
- fputs
- fread
- fseek
- ftell
- fwrite
- getc
- getchar
- getnearestprogramsymbol
- getprogramsymboladdress
- gets
- globalsourcepath
- go
- halt
- help
- homepath
- idcode
- if
- include
- invd
- irscan
- isdebugsymbol
- isem64t
- isprogramsymbol
- isrunning
- issleeping
- issmm
- itpcompatible
- jtagchain
- jtagconfigure
- jtagdeviceadd
- jtagdeviceclear
- jtagdevices
- jtagscan
- jtagtest
- keys
- last
- last_jtag_device
- left
- libcall
- license
- linear
- list, nolist
- load
- loadbreakpoints
- loadlayout
- loadproject
- loadtarget
- loadwatches
- log, nolog
- log10
- loge
- logmessage
- macropath
- Memory Access
- messagebox
- mid
- msgclose
- msgdata
- msgdelete
- msgdr
- msgdump
- msgir
- msgopen
- msgreturndatasize
- msgscan
- msr
- num_activeprocessors
- num_all_devices
- num_devices
- num_jtag_chains
- num_jtag_devices
- num_processors
- num_uncore_devices
- openipc
- pause
- physical
- port
- pow
- print cycles
- printf
- proc
- processorcontrol
- processorfamily
- processormode
- processors
- processortype
- projectpath
- putchar
- puts
- rand
- readsetting
- reconnect
- Register Access
- reload
- reloadproject
- remove
- reset
- restart
- return
- right
- runcontroltype
- safemode
- save
- savebreakpoints
- savelayout
- savewatches
- selectdirectory
- selectfile
- shell
- show
- sin
- sizeof
- sleep
- softbreak, softremove, softdisable, softenable
- sprintf
- sqrt
- srand
- step
- stop
- strcat
- strchr
- strcmp
- strcpy
- _strdate
- string [ ] (index into string)
- strlen
- _strlwr
- strncat
- strncmp
- strncpy
- strpos
- strstr
- _strtime
- strtod
- strtol
- strtoul
- _strupr
- swbreak
- switch
- swremove
- tabs
- tan
- tapdatashift
- tapstateset
- targpower
- targstatus
- taskattach
- taskbreak, taskremove, taskdisable, taskenable
- taskend
- taskgetpid
- taskstart
- tck
- time
- uncoreconfigure
- uncorescan
- #undef
- unload
- unloadproject
- upload
- use
- verify
- verifydeviceconfiguration
- verifyjtagconfiguration
- version
- viewpoint
- vpalias
- wait
- wbinvd
- while
- windowrefresh
- wport
- writesetting
- yield
- yieldflag
asm
Display memory as disassembled instructions or assemble instructions in-line.
Syntax
Disassembler:
[[px]] asm addr-spec
Assembler:
[[px]] asm addr-spec = "statement" [, "statement"]
ย
[[px]] asm addr =
Where:
[px] |
is the viewpoint override, including punctuation ([]), specifying that the viewpoint is temporarily set to processor x of the boundary scan chain. ย The processor can be specified as px (where x is the processor ID), or an alias you have defined for a given processor ID. ย ALL cannot be used as a viewpoint override. |
addr-spec |
{ addr l addr to addr l addr length expr } |
statement |
{ instruction l directive } |
addr |
specifies an address for display or assembly. |
length |
specifies the number of instructions to be displayed. |
expr |
specifies a number or an expression that indicates the number of instructions to be displayed. |
instruction |
is the Intel assembly language instruction. |
directive |
is an assembly language directive or comment. |
Discussion
Use the asm command to display memory as disassembled instructions or to in-line assemble instructions into memory. The output from the asm command is a fixed format. For more control of disassembler output, the Code window should be used. The in-line assembler is provided to enable quick patches in active memory. The assembler uses a single pass, and therefore cannot use labels that have not yet been defined; however, the command language offers the ability to define labels, and the assembler offers the org directive for out-of-order assembly.
Disassembler
Displays memory as disassembled instructions. When disassembling, the displayed instructions will be look something like this:
addr codebytes mnemonic [[operand,] operand]
Where:
addr |
specifies the address of the start of the instruction. |
codebytes |
is the byte encoding of the instruction. ย ย |
mnemonic |
is the instruction mnemonic. |
operand |
is an instruction operand. The number of operands is instruction specific. There may be zero or more. |
Example 1
To display a single instruction at offset 0ah in the current code segment:
Command input:
asm 0ah
Result:
00000000AH 0000 ADD [BX+SI] ,AL
Example 2
To display three instructions beginning at the current execution point:
Command input:
asm cs:ip length 3
Result:
00C3:00000000H 55 PUSH EBP
00C3:00000001H 8BEC MOVE EBP,ESP
00C3:00000003H 81EC04000000 SUB ESP,4H
Example 3
To display two instructions beginning at offset 0 in the code segment with selector 25 referenced through the LDT with selector 98:
Command input:
asm 098:025:0000H length 2
Result:
0098:0025:00000000H 9A00000000D100 CALL 0D1:0H
0098:0025:00000007H 66CF IRET
Example 4
To display instructions from linear address 11426 to 11430:
Command input:
asm 11426L to 11430L
Result:
00011426L 0000 ADD [BX+SI] ,AL
00011428L 0000 ADD [BX+SI] ,AL
0001142AL 0000 ADD [BX+SI] ,AL
0001142CL 0000 ADD [BX+SI] ,AL
0001142EL 0000 ADD [BX+SI] ,AL
Assembler
The assembler assembles instructions in-line using the current processor modes and settings and places the instruction code in memory. The current focus processor settings are used by default, but may be overridden by the command language or assembler directives. The assembler has been designed to accept all of the assembler forms output by the SourcePoint disassembler as well as the common forms found in Intel assemblers.
mov |
ax, table[bx][di] |
mov |
ax, table[di][bx] |
mov |
ax,table[bx+di] |
mov |
ax,[table+bx+di] |
mov |
ax,[bx][di]+table |
Operand size can be explicitly represented with the PTR operator. The PTR keyword should be preceded immediately by one of the size keywords.
byte ptr |
unsigned byte (8-bit) |
sbyte ptr |
signed byte (8-bit) |
word ptr |
unsigned word (16-bit) |
sword ptr |
signed word (16-bit) |
dword ptr |
doubleword (32-bit) |
sdword ptr |
signed doubleword (32-bit) |
dfword ptr |
farword (48-bit) |
dqword ptr |
quadword (64-bit) |
tbyte ptr |
ten-byte (80-bits) |
For instance:
mov |
eax, byte ptr foo |
mov |
eax, word ptr bar |
Jump size can be explicitly represented with one of the distance operators.
short |
jump short, relative |
near |
jump near, relative |
near16 |
jump near 16-bit, relative |
near32 |
jump near 32-bit, relative |
far |
jump far, absolute |
far16 |
jump far 16-bit, absolute |
far32 |
jump far 32-bit, absolute |
For instance:
jmp |
near ptr target |
jmp |
far32 ptr thing+0x122 |
Numbers entered into the assembler have the default radix specified by the command language. The default can be changed via the base command.
Radix overrides are allowed as either prefix or suffix operators. See constants.
The $ symbol may be used as a shorthand key for the current assembly address. The $ can be used alone or inside an expression (e.g., $+10). This makes it easy to enter loops.
Example
To generate an infinite loop at the current execution point:
Command input:
asm $ = "jmp $"
Numeric expressions can be formed wherever a number or address is required. The following expression operators are recognized.
/ |
n / m |
integer divide |
* |
n * m |
integer multiply |
+ |
+n |
unary plus |
+ |
n + m |
integer addition |
- |
-n |
unary minus |
- |
n - m |
integer subtraction |
( ) |
(n * m) - p |
precedence grouping |
When assembling, the instructions can be entered in one of two forms: batch and interactive.
Batch Assembly
The first form allows multiple instructions to be entered on a single line. The instructions must be enclosed in quotation marks and separated by commas. Multiple lines can be used; ending a line with a comma indicates line continuation. The instructions are parsed and placed in memory. Any errors encountered are reported at the end. This form is well suited to inclusion in macros or procedures. This is also the form to use to fill a region of memory with an instruction sequence.
If a range of memory is given as the addr-spec using either the addr to addr or addr length expr, then that range of memory is filled with the code bytes generated by the statements given. This is very useful for rapidly filling memory with single or repeated instruction sequences.
Example 1
To patch 16 NOP instructions starting at address 5000:
Command input:
asm 5000 len 16t = "nop"
Example 2
To fill a region of memory starting at physical address 4000 with 20 repetitions of a repeating sequence of instructions:
Command input:
asm 4000 len 20t = "add bx,ax", "add cx,ax"
Interactive Assembly
The second form of in-line assembly provides an interactive interface. The first line gives the asm command, the starting address, and the equals sign. Each successive line gives a single instruction. To end assembly, the special command ENDASM can be used. Alternatively, if the form is being typed interactively by the user, a blank line can be used to terminate assembly. When used in a macro, debug procedure, or include file, the ENDASM command is required.
Note: Interactive assembly is not available within procedures.
Unlike the batch assembly mode, the interactive mode performs memory updates as the statements are entered. The user can follow the progress by noting that the address prompt will advance to the next address. If an error is encountered during interactive assembly, a message is output, the address doesn't advance, and the user is given another chance to enter the statement.
If a range of memory is given as the addr-spec using either the addr to addr or addr length expr form, then that range of memory is filled with the code bytes generated by the statements given. This is useful for rapidly filling memory with single or repeated instruction sequences.
Example
To patch code starting at address 4000:
Command input:
asm 4000 =
@00004000>mov bx,ax
@00004004>mov bx,ax
@00004008>endasm
Assembler Directives
A number of assembly directives are supported. Most of the directives are meant for interactive use, but all are available in batch.
Address Mode Directive { use16 | use32 }
Where:
use16 |
temporarily overrides the code size indicated by the current processor state. ย This allows you to input 16-bit code while the processor is in 32-bit mode.* |
use32 |
temporarily overrides the code size indicated by the current processor state. ย This allows you to input 32-bit code while the processor is in 16-bit mode.* |
* The command language use control variable may have already overridden the current processor setting. ย If so, then the assembler use16 and use32 directives temporarily override the mode set via the command language override and not the current processor default.
Address Directive
org addr-expr
Where:
addr-expr |
is the numeric and/or symbolic expression that evaluates to an address. |
Data Directive
data-op data-value
ย
Where:
data-value { data | count dup ( [ data, ] data ) }
data { integer | float | string }
data-op is one the following:
db or byte |
Defines unsigned bytes of data (8-bit) |
sbyte |
Defines signed bytes of data (8-bit) |
dw or word |
Defines unsigned words of data (16-bit) |
sword |
Defines signed words of data (16-bit) |
dd or dword |
Defines doublewords of data (32-bit) |
sdword |
Define signed doublewords of data (32-bit) |
df or dfword |
Defines farword data (48-bit) |
dq or dqword |
Defines quadwords of data (64-bit) |
dt or tbyte |
Defines ten-byte data (80-bits) |
ddq or dqword |
Defines 16-byte data (128-bit) |
real4 |
Defines short real data (32-bits) |
real8 |
Defines long real data (64-bits) |
real10 |
Defines ten-byte real data (80-bits) |
real16 |
Defines 16-byte real data (128-bit) |
Assembler Directives
Example 1
To enter a string as data at linear address 1000:
Command input:
asm 1000L =
P0@00001000L>byte "This is a test string."
P0@00001016L>
Example 2
To clear 10 bytes to zero starting at linear address 5432:
asm 5432L =
P0@00005432L>db 10 dup ( 0 )
P0@0000543CL>
Example 3
To enter a few floating pointer numbers starting at physical address 4000:
asm 4000p=
P0@00004000P>real4 12.34
P0@00004004P>real8 5.234
P0@0000400CP>real16 543.34
P0@0000401CP>
Example 4
To enter data at one location (linear 1000) and then place instructions to use the data at another location (linear 2000):
asm 1000l=
P0@00001000L>dw 1
P0@00001002L>org 2000l
P0@00002000L>mov eax, word ptr [1000]
P0@00002004L>
Related Topics
ย
ย