assembly


Using hex numbers in MSP430 assembler


I'm new to assembly (we are using it at school with an MSP430 controller) and I'm trying to do two things.
moving an hex number to a certain location: mov #FFFh, R5 (moving it into the fifth register)
comparing an hex number with another: cmp #FFFh, #45
mov.b #0, R4 ; indice
mov.b #0, R5 ; contatore
bis.b #00000001b, P1DIR ; led rosso
bis.b #10000000b, P4DIR ; led verde
main_loop: cmp #19, R5
jz end
cmp #FFFFh, 2C00h(R4)
jnz nope
jmp yep
nope: inc.b R4
jmp main_loop
yep: inc.b R4
inc.b R5
jmp main_loop
end: cmp #5, R5
jge red_led
jmp green_led
red_led: bis.b #00000001b, P1OUT
green_led: bis.b #10000000b, P4OUT
The compiler log (we are using CCS, CodeComposer) says:
"../main.asm", ERROR! at EOF: [E0300] The following symbols are undefined:
FFFFh
How can I fix this?
A word starting with a digit (0 … 9) is interpreted as a number.
A word starting with a letter (A … Z) is interpreted as a name (of a register or a variable or a label).
So when a hexadecimal number starts with a letter, you must add a zero:
cmp #0FFFFh, 2C00h(R4)

Related Links

why is i++ not thread safe on a single core machine? [duplicate]
calling fscanf in assembly using nasm
How does parameter passing for the g++ equivalent for __declspec ( naked ) work?
Assembly, multicore and per core threads: How is a thread is spawned in assembly?
Assembly language programming hints and tips [closed]
Assembly code from Ocaml
What compiler would I use to write machine language?
Loading a floppy disk image with a boot binary
Where can I find resources to learn inline assembly in C using AT&T syntax? [closed]
how to implement a new line
What does “short” jump mean in assembly language?
MIPS Is it elegant to use $s0… etc reginsters inside the procedure and restore it on end
MASM StdOut integer value instead of ASCII representation
pop or add esp, 4 ? What is the difference?
writing programs in assembly [duplicate]
Segfault with x86 assembly

Categories

HOME
shell
eclipse
search
localization
apache-jena
object
rsa
yahoo-finance
devise
dojo
square
azure-container-service
opengl-3
project
mql5
windows-ce
3nf
sigma.js
google-maps-autocomplete
cgbitmapcontext
href
ember-cli
easeljs
short-url
google-api-client
bulletphysics
android-sharedpreferences
tpm
carrierwave
panoramas
dynamic-jasper
pdw-file-browser
servicestack-text
raft
opensmpp
ogc
laravel-elixir
movilizer
sharp-snmp
apollostack
vaadin-elements
servermanager
jboss-4.2.x
spring-integration-sftp
yii2-api
reportservice2010
twilio-click-to-call
aquamacs
skin
arules
cpu-cache
jtree
ampps
omxplayer
custom-lists
ziparchive
wso2developerstudio
tooleap
vorpal.js
libav
invoke-sqlcmd
flock
fuelcms
visual-sourcesafe-2005
iced-coffeescript
dronekit-android
canvg
cryptographichashfunction
mruby
jbake
spy++
linkedin-jsapi
grails-domain-class
git-repo
getopt
visual-studio-express
embedded-fonts
ebay-lms
kaleidoscope
qi4j
nokia-s40
apache-whirr
isa-swizzling
pylucene
timthumb
http-daemon
jqueryform
dot-emacs
binomial-heap
ajax-polling
interprocess
lxr
mathematical-notation
scrubyt
todos
blind

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App