summaryrefslogtreecommitdiffhomepage
path: root/mixlib
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-09-16 22:38:43 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-09-16 22:38:43 +0000
commit1f61976653a898417d8f03ff64f774c43e83859a (patch)
tree2248c6478f235654ac8938dcffcda3c0655b40b8 /mixlib
parent55bc237a945eff8fddf6c9dd74cb1607f5b07977 (diff)
downloadmdk-1f61976653a898417d8f03ff64f774c43e83859a.tar.gz
mdk-1f61976653a898417d8f03ff64f774c43e83859a.tar.bz2
maintain virtual machine status
Diffstat (limited to 'mixlib')
-rw-r--r--mixlib/xmix_vm.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/mixlib/xmix_vm.h b/mixlib/xmix_vm.h
index e0f26ae..60185df 100644
--- a/mixlib/xmix_vm.h
+++ b/mixlib/xmix_vm.h
@@ -2,6 +2,8 @@
* This file contains internal declarations used in the implementation
* of the mix_vm_t type.
* ------------------------------------------------------------------
+ * $Id: xmix_vm.h,v 1.6 2001/09/16 22:38:43 jao Exp $
+ * ------------------------------------------------------------------
* Copyright (C) 2000 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
@@ -41,7 +43,7 @@ struct mix_vm_t
gboolean overflow;
mix_cmpflag_t cmpflag;
mix_short_t loc_count;
- gboolean is_halted;
+ mix_vm_status_t status;
mix_device_t * devices[BD_NO_];
mix_address_t start_addr; /* start address of loaded file */
GTree *line_table; /* source line no -> address */
@@ -77,6 +79,7 @@ enum { A_ = 0, X_, J_, I1_, I2_, I3_, I4_, I5_, I6_ };
#define get_clock_(vm) (vm->clock)
#define get_pred_list_(vm) (vm->pred_list)
#define get_address_list_(vm) (vm->address_list)
+#define get_status_(vm) (vm->status)
#define set_reg_(vm,r,x) \
do { \
@@ -97,14 +100,16 @@ do { \
#define set_over_(vm,x) (vm)->overflow = (x)
#define set_loc_(vm,x) (vm)->loc_count = (x)&MIX_SHORT_MAX
+#define set_status_(vm,s) ((vm)->status = (s))
+
#define inc_loc_(vm) \
do { \
vm->loc_count++; \
vm->loc_count &= MIX_SHORT_MAX; \
} while(FALSE)
-#define is_halted_(vm) ((vm)->is_halted)
-#define halt_(vm,val) ((vm)->is_halted = (val))
+#define is_halted_(vm) ((vm)->status == MIX_VM_HALT)
+#define halt_(vm,val) ((vm)->status = (val)? MIX_VM_HALT : MIX_VM_RUNNING)
#define set_start_(vm,val) ((vm)->start_addr = (val))
#define reset_loc_(vm) set_loc_ (vm, vm->start_addr)
#define update_time_(vm,ins) mix_vm_clock_add_lapse (get_clock_(vm), ins)