Explore chapters and articles related to this topic
Control Structures and Subroutines
Published in Syed R. Rizvi, Microcontroller Programming, 2016
The main goal of this chapter is to understand the basic concepts of control structures and subroutines using HC11 instructions. A subroutine is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code. A subroutine is often created so that it can be started (“called”) several times and/or from several places during a single execution of the program, and then branch back (return) to the next instruction after the “call,” once the subroutine’s task is done. The topics covered in this chapter are such that as the chapter progresses, the readers will be able to write simple programs that move, store, and transfer data using INH, IMM, DIR, and EXT addressing modes involving conditional flow using IF-THEN-ELSE control structure and program loops using WHILE and UNTIL repetition structures. We will also introduce the concept of stack, and discuss its role in subroutines. Finally, we will list some of the frequently used BUFFALO utility subroutines.
Digital Systems
Published in Wai-Kai Chen, Analog and VLSI Circuits, 2018
Festus Gail Gray, Wayne D. Grover, Josephine C. Chang, Bing J. Sheu, Roland Priemer, Rung Yao, Flavio Lorenzelli
SP—Stack Pointer. It holds an address that points to RAM that can be used for temporary storage. It can be loaded, incremented, and decremented by asserting appropriate enable inputs. Certain instructions can cause its content to be transferred to the MAR for a memory read or write operation. The RAM that is referenced with the SP is called the stack. Typically, the SP is implicitly decremented before (after) writing to the stack, and it is implicitly incremented after (before) reading from the stack. Thereby, the stack is a last in and first out memory area that is used to support, among other things, subroutine calls.
S
Published in Phillip A. Laplante, Dictionary of Computer Science, Engineering, and Technology, 2017
subroutine a section of a program that defines a computation that can be requested from other locations of the program by using a subroutine call, also known as a function call. The computation of a subroutine may be modified by values supplied at the time of the subroutine call by specifying parameters. Synonyms: function, procedure, routine. In some programming languages, these terms are defined more specifically. For example, in FORTRAN, a “function” can return a value and be used as a part of an expression, while a “subroutine” is defined as the target of a CALL statement and cannot return a value or be used in an expression.
Simplified approach for soil-spring stiffness prediction of pile group
Published in International Journal of Geotechnical Engineering, 2022
Lassaad Hazzar, Mourad Karray, Admir Pasic
The 3D FD program FLAC3D (Itasca Consulting Group 2009) was employed to study the lateral displacement, lateral resistance and stiffness of a single pile and pile group. Figure 6 shows the 3D finite difference grids used in the numerical analyses. A grid generator subroutine was implemented using the FISH built–in programming language providing the possibility of grid refinement and geometry variation. The bottom elevation and the lateral sides of the computational domain were taken far enough from the group to avoid any significant boundary effect. In order to make sure that the zones size has no effect on the response of the characteristic piles, trial analyses have been carried out to optimize mesh discretization. More specifically, the response of each characteristic pile has been established carrying out an analysis in which only this pile was activated. The responses of these piles have been compared and mesh re-adjustment was performed as necessary.
Damage advancement behavior in braided composite structures for mini aerial vehicles
Published in Mechanics of Advanced Materials and Structures, 2018
Yucheng Zhong, Ravindrababu Suraj, Chen Wang, Elvin Ser Ming Chia, Sunil Chandrakant Joshi, Zhong Chen
The maximum stress failure criterion was coded in USDFLD user subroutine using Fortran 77 programming language. When failure was detected (failure index ≥1) due to certain failure modes (e.g., failure due to fiber compression), the elastic constants of the material would be degraded through the usage of solution-dependent state variables and field variables. The general material property degradation strategy was that if the failure was detected the elastic constants would be reduced to 1% of their original magnitude. The stiffness matrix of the material would be updated and returned to the ABAQUS solver for the stress analysis of the next iteration.
New analytical-modelling method to interpret flexural bending fatigue response of asphalt mixture using the S-VECD theory
Published in International Journal of Pavement Engineering, 2021
Damage evolution function Equation (4) and material characteristic function Equation (5) provide a constitutive model for fatigue damage response by solving C and S values. Equations (4) and (5) are a pair of high-order equations with C and S as two unknown variables, but such equations can have no real value solutions. There is no evolving form of stiffness parameter C that can be expressed as damage S and loading time. In this case, computational trial and error can provide approximate solutions. Therefore, the purpose of a self-programmed subroutine is to find the approximate values for C and S with each time step increment (treated as each cycle) through computational trial and error. In this study, this is achieved by calculating a C value that yields minimal difference between two S values calculated by Equations (4) and (5). A UMAT subroutine serving such purpose has been constructed based on Fortran programming language, following the logic chart indicated in Figure 3. The general framework of the subroutine is applicable for any material following the VECD theory, plus for time-based and cyclic-based values. However, the current program is calibrated and tested specifically for the S-VECD model of asphalt mixture. This constitutive model is focusing on updating cyclic fatigue parameters for each time increment. It avoids change of stress–strain relationship inside ABAQUS itself, which circumvents the modelling of deformation response and other complexities required by the complete multi-axial VECD model (Kim et al.2009). As a result, calculation tools, such as spread sheet, have to be used for real stiffness computation. In exchange, it provides a faster and more stable modelling for a large number of cycles required catered for the need of asphalt fatigue.