Skip to content

Commit

Permalink
DSL: add support for "data instructions"
Browse files Browse the repository at this point in the history
  • Loading branch information
janvrany committed Aug 5, 2024
1 parent 7817215 commit a403d17
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/ArchC-DSL/AcDSLAssembler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ AcDSLAssembler >> append: mnemonic operands: operands [
^ insn.
]

{ #category : #'emitting-private' }
AcDSLAssembler >> appendDC: dataClass operands: operands [
operands asAcDSLOperandList do: [:operand |
| data |

data := dataClass new
isa: self isa;
value: operand;
relocation: operand relocation;
yourself.
self append: data
].
]

{ #category : #'emitting - data' }
AcDSLAssembler >> byte: bytes [
^ self appendDC: AcByte operands: bytes
]

{ #category : #accessing }
AcDSLAssembler >> cursor: anInteger [
memory cursor: anInteger
Expand Down Expand Up @@ -101,6 +120,21 @@ AcDSLAssembler >> initialize [
memory := AcDSLCodeBuffer new
]

{ #category : #'emitting - data' }
AcDSLAssembler >> int16: int16s [
^ self appendDC: AcInt16 operands: int16s
]

{ #category : #'emitting - data' }
AcDSLAssembler >> int32: int32s [
^ self appendDC: AcInt32 operands: int32s
]

{ #category : #'emitting - data' }
AcDSLAssembler >> int64: int64s [
^ self appendDC: AcInt64 operands: int64s
]

{ #category : #accessing }
AcDSLAssembler >> isa [
^ self class isa
Expand Down

0 comments on commit a403d17

Please sign in to comment.